#!/usr/bin/perl
# 
# Exercise 11-8
# 
# Write a recursive subroutine to determine the size of an array. You may want to use 
# the pop or unshift functions. (Ignore the fact that the scalar @ array returns the size 
# of @array!) 
#

my @a = ('1', '2', '3', '4', '5', '6');

print size_of_array(@a), "\n";

exit;

sub size_of_array {
	my(@array) = @_;

	if( not @array ) {
		return 0;
	}else{
		pop @array;
		return (1 + size_of_array(@array));
	}
}
